package com.FH.permission.member_file;

import com.FH.util.ResultDTO;

import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;

@Path("/memberfile")
@Produces(MediaType.APPLICATION_JSON)
@RequestScoped
public class MemberFileResource {

    @EJB
    private MemberFileDAO memberFileDAO;


    @POST
    @Consumes(MediaType.APPLICATION_JSON)
    public ResultDTO addMemberFile(MemberFilePullDTO memberFilePullDTO){
        return memberFileDAO.addMemberFile(memberFilePullDTO);
    }

    @GET
    @Path("/{member_id}")
    public ResultDTO getFileGuiById(@PathParam("member_id") String member_id){
        return memberFileDAO.getFileById(member_id);
    }

    @PUT
    @Path("/delete")
    @Consumes(MediaType.APPLICATION_JSON)
    public ResultDTO deleteMemberFile(MemberFilePullDTO memberFilePullDTO){
        return memberFileDAO.deleteMemberFile(memberFilePullDTO);
    }
}
